/**
 * 产品查看js
 */
var productInfoLook={
	dataCache:null,
		
	startEvent:function(){
		$("#recordTab ul").idTabs();
		productInfoLook.showInfoById();
	},
	
	showInfoById:function(){
		var lokId=art.dialog.data('lokId');  //查看id
		var url = 'mgr/OverseaSafeInfoCtrl/getOverseaSafeInfoById';
		var params ={
				'id':lokId
		};
		var cb = function(data){
			if(data.resultCode==200){
				var ret=data.result;
				for(var i in ret){
					var text=ret[i];
					if(i=='createDate'){
						text=text==null?'':(new Date(text)).format('yyyy-MM-dd hh:mm:ss');
					}else if(i=='safeCompany'||i=='contributionsTime'||i=='tbAge'||i=='gkCoin'||i=='firstGktype'||i=='againGktype'){
						text=jsUtils.getDictionaryTxtByType(i, text);
					}else if(i=='prodType'){
						i='oprodType';
						text=jsUtils.getDictionaryTxtByType(i, text);
					}else if(i=='proStatus'){
						i='oproStatus';
						text=jsUtils.getDictionaryTxtByType(i, text);
					}else if(i=='hotSale'){
						text=(text==null?'':(text==0?'否':'是'));
					}else if(i=='proPic'){
						if(text!=''&&text!=null){
							text='<a href="'+SERVER_PATH+'photo/'+text+'" target="_blank">'+text+'</a>';
						}else{
							text='';
						}
					}
					$('#com-addForm td[name="'+i+'"]').html(text);
				}
				$('#proFeatureTxt').html((ret.proFeatureTxt==null?'':ret.proFeatureTxt));
				$('#proEnsureTxt').html((ret.proEnsureTxt==null?'':ret.proEnsureTxt));
				$('#coverCaseTxt').html((ret.coverCaseTxt==null?'':ret.coverCaseTxt));
				$('#coverFlowTxt').html((ret.coverFlowTxt==null?'':ret.coverFlowTxt));
			}
		};
		sendApiNoLoad(url, params, cb, 'POST');
	},
	
	init:function(){
		productInfoLook.startEvent();
	}
}
$(document).ready(function() {
	productInfoLook.init();
});